<?php
@header("Content-type:text/html;charset=GB2312");
defined('BASEPATH') OR exit('No direct script access allowed');

class Address extends CI_Controller
{
    function index(){
        $my = $this->load->database('default', TRUE);
        $ms = $this->load->database('sqlserver', TRUE);

        $size = 500;
        $page = isset($_GET['page']) ? $_GET['page'] : 1;
        $zongshu = $page * $size;

        $sql = "select top $size * from (select top $zongshu  * from NC_DownAddress order by id asc) NC_DownAddress order by id desc";
        $msq = $ms->query($sql)->result_array();
        $m = array();
        foreach($msq as $v){
            $k = array(
                'id'=> $v['id'],
                'ChannelID'=> $v['ChannelID'],
                'softid'=> $v['softid'],
                'downid'=> $v['downid'],
                'DownFileName'=> $v['DownFileName'],
                'DownText'=> $v['DownText'],
            );
            $m[] = $k;
        }
        var_dump("<pre>");
        var_dump($m);
    }
}